package ua.epam.muzalevskiy.traction.vehicle;

/**
 * Current class describe vehicle entity, is parent for every vehicle in
 * project.
 *
 * @author Muzalevskiy Vitaliy
 */
public class Vehicle {
    
    /** Identifier of vehicle, must be unique. */
    protected int vehicleID;
    /** Number of vehicle, must be unique. */
    protected String vehicleNumber;
    /** Current flag present if vehicle assigned to some route. */
    protected boolean assignedToRoute;
    /** Identifier of route to which current vehicle assigned.  */
    protected int routeID;
    private VehicleType type;

    public Vehicle(int vehicleID, String vehicleNumber, VehicleType type) {
        this.vehicleID = vehicleID;
        this.vehicleNumber = vehicleNumber;
        this.type = type;
    }

    /**
     * @return the vehicleID
     */
    public int getVehicleID() {
        return vehicleID;
    }
    
    /**
     * @return the vehicleNumber
     */
    public String getVehicleNumber() {
        return vehicleNumber;
    }

    /**
     * @return the assignedToRoute
     */
    public boolean isAssignedToRoute() {
        return assignedToRoute;
    }

    /**
     * @param assignedToRoute the assignedToRoute to set
     */
    public void setAssignedToRoute(boolean assignedToRoute) {
        this.assignedToRoute = assignedToRoute;
    }

    /**
     * @return the routeNumber
     */
    public int getRouteID() {
        return routeID;
    }

    /**
     * @param routeNumber the routeNumber to set
     */
    public void setRouteID(int routeID) {
        this.routeID = routeID;
    }

    @Override
    public String toString() {
        return "[" + "vehicleNumber=" + vehicleNumber + ", assignedToRoute=" 
                + assignedToRoute + ", routeNumber=" + routeID + ']';
    }
    
    /**
     * Current method need to know wot type of vehicle there is.
     *
     * @return <code>VehicleType</code> value that describe type of vehicle.
     */
    public VehicleType getType(){
        return type;
    }
    
}
